from django.conf.urls import patterns, include, url
from django.contrib.auth.models import User,Group
from rest_framework import viewsets,routers
from quickstart import views
from django.conf.urls import include

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

from snippets.views import SnippetViewSet, UserViewSet

class UserViewSet(viewsets.ModelViewSet):
    model = User

class GroupViewSet(viewsets.ModelViewSet):
    model = Group


router = routers.DefaultRouter()
router.register(r'users',UserViewSet)
router.register(r'groups',GroupViewSet)
router.register(r'snippets', SnippetViewSet)


urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'django_restapi_test.views.home', name='home'),
    # url(r'^django_restapi_test/', include('django_restapi_test.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
    url(r'^',include(router.urls)),
    url(r'^', include('snippets.urls')),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
)
